/**
 * 逻辑、功能相关描述:
 *
 * @author yandawei 编写日期：2008-9-22
 */
package com.ce.pms.common.model;

import java.util.Date;

import javax.persistence.*;
import com.ce.pms.customer.model.ParticipantDO;
import com.ce.pms.house.model.HouseDomain;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:业务管理操作日志 关联数据表:OPER_ACTION_LOG
 *
 */
@Entity
@Table(name = "OPER_ACTION_LOG")
public class OperActionLogDomain implements IDomainObject {

	/**
	 * 操作日志ID
	 */
	@Id
	@GeneratedValue
	@Column(name = "ACTION_ID")
	private Long actionId;

	/***************************************************************************
	 * 房屋
	 */
	@ManyToOne
	@JoinColumn(name = "HOUSE_ID", nullable = false)
	private HouseDomain house;

	/***************************************************************************
	 * 参与人(如果数据字典表定义的 LOG_FUNCTION_MODEL值为001和002 则 该字段不能为空)
	 */
	@ManyToOne
	@JoinColumn(name = "PARTICIPANT_ID")
	private ParticipantDO participant;

	/***************************************************************************
	 * 功能模块(参考数据字典表定义(sys_ref_code=LOG_FUNCTION_MODEL)) 001 新增业主资料 002 修改业主资料
	 * 003 入住 004 搬出 005 入伙 006 退伙
	 */
	@Column(name = "LOG_FUNCTION_MODEL", nullable = false, length = 3)
	private String funMode;

	/***************************************************************************
	 * 参考数据字典表定义(OPERATION_LOG_ACTION_TYPE) 001 新增房间 002 修改房间 003 删除房间 004 新增业主
	 * 005 修改业主 006 新增家庭成员 007 修改家庭成员 008 删除家庭成员 009 入住 010 搬出 011 缴钥匙结束 012
	 * 变为历史业主
	 */
	@Column(name = "LOG_ACTION_TYPE", nullable = false, length = 3)
	private String actionType;

	/**
	 * 操作描述
	 */
	@Column(name = "ACTION_DESCRIPTION", length = 1000)
	private String actionDescription;

	/***************************************************************************
	 * 终端IP
	 */
	@Column(name = "TERMINAL_IP")
	private String terminalIP;

	/***************************************************************************
	 * 终端
	 */
	@Column(name = "TERMINAL")
	private String terminal;

	/***************************************************************************
	 * 操作员
	 */
	@Column(name = "ACTION_USER", nullable = false)
	private Long actionUserId;

	/**
	 * 操作日期
	 */
	@Temporal(TemporalType.DATE)
	@Column(name = "ACTION_DATE", nullable = false)
	private Date actionDate;

	/**
	 * 备注
	 */
	@Column(name = "REMARK", length = 500)
	private String remark;

	public OperActionLogDomain() {

	}

	/**********************************construct*************************************
	 *
	 * @param house
	 *            房屋
	 * @param funModeId
	 *            功能模块
	 * @param actionType
	 *            操作类型
	 */
	public OperActionLogDomain(HouseDomain house, String funMode,
			String actionType) {
		this.house = house;
		this.funMode = funMode;
		this.actionType = actionType;
	}

	/******************************getters and setters ******************************/

	public Date getActionDate() {
		return actionDate;
	}

	public void setActionDate(Date actionDate) {
		this.actionDate = actionDate;
	}

	public String getActionDescription() {
		return actionDescription;
	}

	public void setActionDescription(String actionDescription) {
		this.actionDescription = actionDescription;
	}

	public Long getActionId() {
		return actionId;
	}

	public void setActionId(Long actionId) {
		this.actionId = actionId;
	}

	public Long getActionUserId() {
		return actionUserId;
	}

	public void setActionUserId(Long actionUserId) {
		this.actionUserId = actionUserId;
	}

	public String getActionType() {
		return actionType;
	}

	public void setActionType(String actionType) {
		this.actionType = actionType;
	}

	public String getFunMode() {
		return funMode;
	}

	public void setFunMode(String funMode) {
		this.funMode = funMode;
	}

	public HouseDomain getHouse() {
		return house;
	}

	public void setHouse(HouseDomain house) {
		this.house = house;
	}

	public ParticipantDO getParticipant() {
		return participant;
	}

	public void setParticipant(ParticipantDO participant) {
		this.participant = participant;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public String getTerminal() {
		return terminal;
	}

	public void setTerminal(String terminal) {
		this.terminal = terminal;
	}

	public String getTerminalIP() {
		return terminalIP;
	}

	public void setTerminalIP(String terminalIP) {
		this.terminalIP = terminalIP;
	}
}
